超時
TimeoutMs 提供了一個可選的超時時間(以毫秒為單位),逾時後 OCR 讀取操作將被取消。
與 AbortToken 類似,TimeoutMs 也有助於在程式或應用程式卡住時讀取大型輸入檔。
請注意, .NET Framework 4.xx 不支援此功能。
準備好開始了嗎?
Nuget 下載 5,585,834 | 版本: 2026.4 剛剛發布
using IronOcr;
int cancel_time = 1000;
// Opens a Large PDF which may need to be cancelled early
IronTesseract ocrTesseract = new IronTesseract() { Language = OcrLanguage.English };
var ocrInput = new OcrInput();
ocrInput.LoadPdf("large-report.pdf");
// Starts a read on the PDF using IronOCR with specified cancel time
OcrReadTask ocrRead = ocrTesseract.ReadAsync(ocrInput, cancel_time);
ocrRead.Wait();
Imports IronOcr
Private cancel_time As Integer = 1000
' Opens a Large PDF which may need to be cancelled early
Private ocrTesseract As New IronTesseract() With {.Language = OcrLanguage.English}
Private ocrInput = New OcrInput()
ocrInput.LoadPdf("large-report.pdf")
' Starts a read on the PDF using IronOCR with specified cancel time
Dim ocrRead As OcrReadTask = ocrTesseract.ReadAsync(ocrInput, cancel_time)
ocrRead.Wait()
Install-Package IronOcr
TimeoutMs 提供了一個可選的超時時間(以毫秒為單位),逾時後 OCR 讀取操作將被取消。
與 AbortToken 類似,TimeoutMs 也有助於在程式或應用程式卡住時讀取大型輸入檔。
請注意, .NET Framework 4.xx 不支援此功能。